home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_gen_doorswitch_underwater.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  111 lines

  1. # Jones 3D Cog Script
  2. #
  3. # General Underwater Door.
  4. #
  5. # [DS]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #===============================================================================
  9.  
  10.  
  11. symbols
  12.  
  13.     message     startup
  14.     message     activated
  15.     message        arrived
  16.     message        timer
  17.  
  18.     thing       switch0
  19.     thing        door0
  20.     thing        indy                nolink    desc=cutscene actor
  21.     thing        campos    
  22.     thing        player                local
  23.     
  24.     flex        movespeed=0.5
  25.     
  26.     sector      doorsector            local
  27.     
  28.     int            doorstatus            local
  29.     int            movestatus            local
  30.     int            curcam=1            local
  31.     int            actit=1                local
  32.  
  33.     keyframe    in_activate=in_uw_pullswitch.key    local
  34.  
  35.     # subroutines
  36.     flex    checkstatus=0.0        local
  37.     flex    opendoors=0.0    local
  38. end
  39.  
  40. code
  41.  
  42. #========================================================================================
  43. startup:
  44.     player = GetLocalPlayerThing();
  45.     doorsector = GetThingSector(door0);
  46.     SetSectorAdjoins(doorsector, 0);
  47.  
  48.     return;
  49.  
  50. #========================================================================================
  51. activated:
  52.     if (GetSenderRef() != switch0) return;
  53.     call checkstatus;
  54.     if(movestatus) return;
  55.     curCam = GetCurrentCamera();
  56.     if(doorstatus == 0)
  57.     {
  58.     SetSectorAdjoins(doorsector, 1);
  59.     SetThingFlags(player, 0x80000);
  60.     SetActorFlags(player, 0x200000);
  61.     CopyPlayerHolsters(player, indy);
  62.     StartCutscene(1);
  63.     ClearThingFlags(indy, 0x80000);
  64.     SetCameraLookInterp(2, 0);            # turns off interp to lookthing.
  65.     SetCameraFocus(2, campos);
  66.     SetCameraSecondaryFocus(2, indy);
  67.     SetCurrentCamera(2);
  68.     SetCameraFOV(90, 0, 0);                # makes sure set to default.    
  69.     SetTimer(1.5);
  70.     actit = PlayKey(indy, in_activate, 4, 0x12, 1);
  71.     SetCurrentCamera(curCam);
  72.     SetThingFlags(indy, 0x80000);
  73.     ClearActorFlags(player, 0x200000);
  74.     ClearThingFlags(player, 0x80000);
  75.     EndCutscene();
  76.     call open_doors;
  77.     }
  78.     return;
  79.  
  80.  
  81. #========================================================================================
  82. arrived:
  83.     if (getsenderref() != door0) return;
  84.     return;
  85.  
  86. #========================================================================================
  87. timer:
  88.     MoveToFrame(switch0, 1, 0.5);
  89.     return;
  90.  
  91. #========================================================================================
  92. open_doors:
  93.     movetoframe(door0, 1, movespeed);
  94.     return;
  95.  
  96.  
  97. #========================================================================================
  98. checkstatus:
  99.     moveStatus = 0;
  100.     doorStatus = 0;
  101.     if (door0 >= 0) {
  102.             moveStatus = moveStatus + IsThingMoving(door0);
  103.             doorStatus = doorStatus + GetCurFrame(door0);
  104.         }
  105.     return;
  106.  
  107.  
  108. #========================================================================================
  109.  
  110. end
  111.